home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CLRCTR10.ARJ / README.TXT < prev    next >
Text File  |  1991-06-15  |  34KB  |  685 lines

  1.                                     CLRCTRL
  2.                       Color Selector Custom Dialog Control
  3.                     for Microsoft Windows (tm) Applications
  4.  
  5.                                    Version 1.0
  6.                                     6/15/1991
  7.  
  8.                         Copyright (c) 1991 Scott Gourley
  9.  
  10.                             Compuserve ID 72311,613
  11.                      105 Union Street, Watertown, MA 02172
  12.                                  (617)-924-5761
  13.  
  14.       Thank you for trying this product!
  15.  
  16.       CLRCTRL is a kit that makes it easy for Microsoft Windows 3.0
  17.       programmers to include color selection controls in their
  18.       application dialogs.  The core of the kit is a "dynamic link
  19.       library," CLRCTRL.DLL, which provides the dialog control in a
  20.       self-contained package that can easily be integrated into any
  21.       program.  The design of the DLL allows the custom control to be
  22.       manipulated the same way a built-in control is manipulated, using
  23.       the Dialog Editor found in the Microsoft Software Development Kit.
  24.  
  25.       The design of the control is that of a combobox that contains
  26.       rectangles of color that can be selected by the user using the
  27.       normal input actions for comboboxes.  By default, the color
  28.       selector uses the standard 16 "pure" colors as its selection
  29.       palette, but this can be changed using normal combobox messages.
  30.  
  31.       The following table gives the "pure" colors and their positions in
  32.       the default color selector control.
  33.  
  34.                                                            Index in
  35.       Color                  RGB value                   combobox list
  36.       ----------------------------------------------------------------
  37.       Black                  RGB (0x00, 0x00, 0x00)           0
  38.       Dark Red               RGB (0x80, 0x00, 0x00)           1
  39.       Dark Green             RGB (0x00, 0x80, 0x00)           2
  40.       Dark Yellow            RGB (0x80, 0x80, 0x00)           3
  41.       Dark Blue              RGB (0x00, 0x00, 0x80)           4
  42.       Dark Magenta           RGB (0x80, 0x00, 0x80)           5
  43.       Dark Cyan              RGB (0x00, 0x80, 0x80)           6
  44.       Dark Grey              RGB (0x80, 0x80, 0x80)           7
  45.       Bright Grey            RGB (0xC0, 0xC0, 0xC0)           8
  46.       Bright Red             RGB (0xFF, 0x00, 0x00)           9
  47.       Bright Green           RGB (0x00, 0xFF, 0x00)          10
  48.       Bright Yellow          RGB (0xFF, 0xFF, 0x00)          11
  49.       Bright Blue            RGB (0x00, 0x00, 0xFF)          12
  50.       Bright Magenta         RGB (0xFF, 0x00, 0xFF)          13
  51.       Bright Cyan            RGB (0x00, 0xFF, 0xFF)          14
  52.       White                  RGB (0xFF, 0xFF, 0xFF)          15
  53.  
  54.  
  55.       FILES INCLUDED IN THIS KIT
  56.  
  57.       The following files are included in this kit:
  58.  
  59.       Custom control files
  60.       --------------------
  61.  
  62.       CLRCTRL.DLL   This is the dynamic link library containing the code
  63.                     that defines and maintains the color selector
  64.                     control.  The library includes code to interface with
  65.                     the user program as well as code to interface with
  66.                     the SDK Dialog Editor.
  67.       CLRCTRL.H     This is the header file that defines the source-code
  68.                     interface to the control.  It contains information
  69.                     that the user program can use to access the control
  70.                     and its DLL library.
  71.  
  72.       Sample program files
  73.       --------------------
  74.  
  75.       CLRTEST       This is the makefile for the CLRTEST.EXE program.
  76.                     It should be generic enough to build the program in
  77.                     your environment.  If not, it can be easily
  78.                     modified.
  79.       CLRTEST.C     This is the source code for the CLRTEST.EXE program.
  80.                     This program provides a simple test of the
  81.                     functioning of the color selector, and serves as an
  82.                     example of using the custom control kit.
  83.       CLRTEST.H     This is the main header file for the CLRTEST.EXE
  84.                     test program.  It contains menu IDs, prototypes,
  85.                     variable defaults, and other information needed by
  86.                     the program.
  87.       CLRTESTD.H    This is the header that contains the dialog IDs used
  88.                     for controls defined in the dialog in CLRTEST.DLG.  
  89.       WINSTD.H      This is a general header file of information to
  90.                     configure Windows applications.
  91.       CLRTEST.DEF   This is the module definition file for the
  92.                     CLRTEST.EXE program.  All Windows applications
  93.                     require a module definition file.
  94.       CLRTEST.RC    This is the resource script file for the CLRTEST.EXE
  95.                     test program.  It contains a definition of the
  96.                     application menu structure.
  97.       CLRTEST.DLG   This is the dialog definition for CLRTEST.EXE test
  98.                     program.  The dialog allows the user to select a
  99.                     text color and a background color, and uses this
  100.                     data to paint the program's main window.
  101.       CLRTEST.ICO   This is the program icon for the CLRTEST.EXE test
  102.                     program.
  103.       CLRTEST.EXE   This is a pre-built copy of the color selector test
  104.                     program.
  105.  
  106.       Documentation files
  107.       -------------------
  108.  
  109.       CLRCTRL.HLP   This is the Windows help file that explains this
  110.                     software kit and how to use it.  It contains largely
  111.                     the same information as this text.
  112.       README.TXT    This text.
  113.  
  114.  
  115.       USES FOR THIS PRODUCT
  116.  
  117.       This custom dialog control gives the Windows programmer a tool to
  118.       easily include color selection in Windows dialogs.  Also, because
  119.       the control is flexible enough to allow its behavior to be
  120.       modified by the programmer, it is useful in any situation where a
  121.       selection of color must be provided.  These situations range from
  122.       simple text and background color selection in a text-based
  123.       application to palette definition in a paint program.  It can be
  124.       up to the programmer what color choices are available and what the
  125.       color choice means to the application program.
  126.  
  127.  
  128.       COLOR SELECTOR CONTROL BEHAVIOR
  129.  
  130.       Because the color selector control is defined as a combobox, all
  131.       of the behavior associated with a normal combobox is supported in
  132.       the color selector.  The only exception to this is that direct
  133.       text entry in the edit field is not implemented.  Because of this,
  134.       the style of the control is more appropriately described as a
  135.       "drop-down listbox," rather than a "combobox," which is used in
  136.       this discussion for consistency with Microsoft's use of the
  137.       terminology. The following paragraphs briefly describe the normal
  138.       functioning of a color selector control.
  139.  
  140.       Keyboard interface
  141.  
  142.       The color selector control receives and relinquishes the keyboard
  143.       input focus as any other control does.  If the programmer defines
  144.       the control to have the WS_TAB style, the user can give the control
  145.       input focus by moving to the control with the TAB key.  If the
  146.       programmer defines the control to be in a group using WS_GROUP, the
  147.       left and right arrow keys also can be used to give the control the
  148.       input focus.  Moving the input focus out of the color selector
  149.       works in the same way.
  150.  
  151.       Once the control has the input focus, the up and down arrows cause
  152.       the currently selected color as displayed in the edit box, to
  153.       change, moving through the defined set of color choices.  Pressing
  154.       Alt-Up arrow or Alt-Down arrow will both cause the listbox to be
  155.       alternately dropped down and removed.  While dropped down, the
  156.       list box will display up to six of the colors defined in the list.
  157.       The up and down arrows then still work in the normal way, moving
  158.       the "item selected" highlighting through the list box as
  159.       appropriate.
  160.  
  161.       Mouse interface
  162.       
  163.       With a mouse, the interface is also straightforward.  Clicking the
  164.       mouse on the control will give the control the input focus if it
  165.       does not already have it.  When it has the input focus, clicking
  166.       on another control will cause the control to lose the input focus.
  167.  
  168.       Clicking on the drop-down button of the control will cause the
  169.       listbox to be displayed (or removed if it is already displayed) as
  170.       described above.  When the list box is dropped down, a new color
  171.       can be selected by using the mouse to scroll through the list and
  172.       click on another color.
  173.  
  174.  
  175.       IMPLEMENTING COLOR SELECTORS
  176.  
  177.       The following sections describe what needs to be done to add color
  178.       selector controls to an application.  The process divides into
  179.       three main parts: accessing the control's DLL; creating and
  180.       editing the dialog with the Dialog Editor; and accessing the
  181.       control from the dialog procedure using the Windows messaging
  182.       scheme.
  183.  
  184.       Accessing the DLL
  185.       -----------------
  186.  
  187.       To use the color selector control, the application must access the
  188.       dynamic link library (DLL) file for the control.  To accomplish
  189.       this, the following steps are necessary:
  190.  
  191.       1.    Load the library.
  192.         
  193.             During program initialization, the DLL library must be
  194.             loaded and initialized by the program.  Add the following
  195.             code to the WinMain function somewhere before the main
  196.             message loop:
  197.  
  198.             HANDLE hClrLib;
  199.             .
  200.             .
  201.             .
  202.             if ((hClrLib = LoadLibrary ("clrctrl.dll")) < 32) return 0;
  203.  
  204.             This code loads the library for the color selector control.
  205.             If it cannot be loaded, returning a zero value from WinMain
  206.             will cause the program to end.  (If program clean-up is
  207.             necessary, do it before the return statement.)
  208.  
  209.             Note that the name of the DLL file is defined in the
  210.             clrctrl.h header file under the symbol "CLRCTRL_DLLNAME."
  211.             This symbol can be used in the LoadLibrary call, provided
  212.             the clrctrl.h file is included by the .c file that contains
  213.             WinMain.
  214.  
  215.       2.    Free the library.
  216.  
  217.             During program shutdown, the DLL library must be released by
  218.             the application.  Add the following code to the WinMain
  219.             function somewhere after the main message loop:
  220.  
  221.             FreeLibrary (hClrLib);
  222.  
  223.             This code releases the program's access to the DLL library.
  224.             The parts of the library that have been loaded into memory
  225.             can be discarded by Windows once no applications are still
  226.             accessing the library, so it is important that any
  227.             application that uses the DLL frees it during shutdown.
  228.  
  229.             Note that the hClrLib parameter needs to be the same value
  230.             as that returned from the call to LoadLibrary.  If the calls
  231.             are both made directly from WinMain, hClrLib can simply be a
  232.             local variable used in both calls.  If the calls are instead
  233.             made from subordinate functions defined in the application,
  234.             programmer needs to provide a way of keeping the value around
  235.             during the life of the program's execution.
  236.  
  237.       3.    Distribute the DLL with the application
  238.  
  239.             Since the DLL becomes a separate but integral part of the
  240.             application, it must be distributed with the application.
  241.             The rules for where Windows looks for the DLL file are
  242.             documented in the Windows SDK Guide to Programming, among
  243.             other places.  Normally, however, it is easiest to keep the
  244.             DLL in the same directory as the application's .EXE file.
  245.  
  246.       Using the Dialog Editor
  247.       -----------------------
  248.  
  249.       The easiest way to add color selector controls to an application's
  250.       dialog is to edit the dialog using the Dialog Editor found in the
  251.       Microsoft SDK.  The following paragraphs describe the steps 
  252.       necessary to add color selector controls to a dialog using the
  253.       Dialog Editor.
  254.  
  255.       Install the custom control library
  256.  
  257.       To access the color selector custom control from within the Dialog
  258.       Editor, the CLRCTRL.DLL file that defines the control must be 
  259.       "installed" in the Dialog Editor.  To do this, execute the Add
  260.       Custom Control menu option from the File menu of the Dialog
  261.       Editor, and give the full pathname of the control's .DLL file.
  262.       This pathname will point to wherever this custom control kit is
  263.       installed.
  264.  
  265.       If the .DLL file ever needs to be de-installed, use the Remove
  266.       Control option from the Dialog Editor's file menu, and choose the
  267.       control library to be removed from the list presented.
  268.       
  269.       Create a color selector in a dialog
  270.  
  271.       To use the color selector in a dialog, choose the Custom menu
  272.       option from the Control menu.  Then choose the CLRCTRL control
  273.       from the list presented.  The control also can be chosen from the
  274.       Toolbox, if it is displayed.  Once the control has been selected,
  275.       position the plus sign cursor where the upper left corner of the
  276.       control should be on the dialog, and click the left mouse button
  277.       to add the control.
  278.  
  279.       Modify the control in the dialog
  280.  
  281.       After adding a color selector to a dialog, it can be moved and 
  282.       resized in the same way as a standard control.  Keep in mind that
  283.       the size of the control is really larger than the visible portion
  284.       of the control, because of the drop-down area.  To make a color
  285.       selector the current object in the Dialog Editor, click the mouse
  286.       in the drop-down area, instead of in the visible area, because the
  287.       latter mouse click will be interpreted by the control and not the
  288.       Dialog Editor.
  289.  
  290.       Also, it is important to note how the vertical size of the control
  291.       affects the control.  The default vertical size of a color 
  292.       selector control is sixty dialog units.  At this size, the height
  293.       of the edit box and drop down button are the same as the height of
  294.       their standard Windows counterparts.  When dropped down, six color
  295.       rectangles are displayed (or fewer if there are less than six
  296.       color choices in the list.)  If the size of the control is changed
  297.       the size of the color rectangles and the size of the edit box and
  298.       drop down button also change.  There will still be six colors
  299.       displayed in the dropped down list.
  300.  
  301.       Within the Dialog Editor, the behavior is different.  If the size
  302.       of the control is changed and the dialog is then tested within the
  303.       Dialog Editor, the edit box and drop down button do not change
  304.       size.  In addition, the number of color rectangles displayed when
  305.       the list box is dropped down changes, instead of the size.  Keep 
  306.       this difference in mind when sizing the color selector controls
  307.       within a dialog.
  308.  
  309.       Control styles
  310.  
  311.       A color selector's ID value is the only "style" associated with
  312.       this type of control.  To modify this value, double-click the
  313.       mouse on the control or make the control the current object and
  314.       press Control-C.  Choosing the Styles menu option in the Edit menu
  315.       also works.  These actions cause the control's styles dialog box
  316.       to be presented, which has an edit field for the control's ID
  317.       value. This ID value field can be used in the same way as with a
  318.       standard control; a number can be entered or a string value can
  319.       be used that equates to a number using a #define in the header
  320.       file associated with the dialog.  See the SDK's Tools manual for
  321.       information on how to maintain a header file of ID values for the
  322.       dialog.
  323.  
  324.       Modifying the dialog by hand
  325.  
  326.       It is also possible to modify the dialog file without using the
  327.       Dialog Editor using a standard text editor.  A color selector
  328.       control in a dialog uses the CONTROL statement in the dialog file
  329.       and its format is the same as the CONTROL statement for a standard
  330.       control.  The class string for color selector's CONTROL statement
  331.       is "ClrCtrl" -- see the SDK tools manual for information on the
  332.       full format of the CONTROL statement.
  333.  
  334.       Dialog procedure handling
  335.       -------------------------
  336.  
  337.       To access a dialog's color selector control from the application,
  338.       code must be added to the dialog procedure to initialize the state
  339.       of the color selector and retrieve its current selected color at
  340.       the end of dialog processing.  To implement this access, perform
  341.       the following steps:
  342.  
  343.       1.    Include the color control header file.
  344.  
  345.             The header file for color selector control access,
  346.             clrctrl.h, should be included in any .c modules that define
  347.             dialogs using the color selector control.  This header file
  348.             defines message codes specific to the color selector and
  349.             other information useful to access the control.
  350.  
  351.       2.    Modify the color choices for the control.
  352.  
  353.             During WM_INITDIALOG message processing for the dialog, it
  354.             is possible to modify the color choices available in the
  355.             control.  To do this, the standard Windows messages for
  356.             modifying items in a combobox can be used.
  357.  
  358.             For the following examples, hClrCtrl is assumed to be an
  359.             HWND value, initialized to be a color selector's window
  360.             handle.  This value can be obtained in several ways, as
  361.             explained in any Windows programming reference.
  362.  
  363.             To add a color selection to the end of the control's list,
  364.             use the CB_ADDSTRING message.  For example,
  365.  
  366.             SendMessage(hClrCtrl, CB_ADDSTRING, 0, RGB(0xC0,0x40,0x00));
  367.  
  368.             will add an orange color to the end of the color selector's
  369.             list.  (Keep in mind that the color capability of the video
  370.             hardware that the application is being run on will determine
  371.             whether a particular RGB color is rendered as a pure color.)
  372.  
  373.             To remove a color choice from the list, determine the index
  374.             of the color in the list (starting at 0) and send the
  375.             CB_DELETESTRING message to the control.  For example,
  376.  
  377.             SendMessage (hClrCtrl, CB_DELETESTRING, 3, 0L);
  378.  
  379.             will remove the fourth color selection in the list.  Note
  380.             that removing an item will cause the indices assigned to all
  381.             colors below the removed color to be decremented by one, so
  382.             if more than one color selection is to be removed, it is
  383.             best to remove them from the bottom up.
  384.  
  385.             To insert a color choice in the middle of the list,
  386.             determine the index of the position at which to insert the
  387.             item and send the CB_INSERTSTRING message to the control.
  388.             For example,
  389.  
  390.             SendMessage (hClrCtrl, CB_INSERTSTRING, 7,
  391.                 RGB (0x80,0x00,0xFF));
  392.  
  393.             will insert a lavender color after the first seven colors
  394.             in the list.  Note that inserting an item will cause the
  395.             indices assigned to all colors below the inserted color to
  396.             be incremented by one, so if more than one color selection
  397.             is to be inserted, it is best to insert them from the bottom
  398.             up.
  399.             
  400.             For special situations, it may be desirable to remove all
  401.             color selections and then add back a complete set.  To do
  402.             this, send the CB_RESETCONTENT message to the control to
  403.             remove all current color selections in the list.  For
  404.             example,
  405.  
  406.             Sendmessage (hClrCtrl, CB_RESETCONTENT, 0, 0L);
  407.  
  408.             will remove all color selections.  (The last two parameters
  409.             are ignored.)
  410.  
  411.       3.    Set the default color choice for the control.
  412.  
  413.             During WM_INITDIALOG processing, it is also possible to
  414.             select the default color choice for a color selector.  This
  415.             can either be a hardcoded default choice, or it can be the
  416.             saved value of the choice that was selected during the last
  417.             time the dialog was processed.  If the index of the desired
  418.             default color choice is known, the CB_SETCURSEL message can
  419.             be sent to the control.  For example,
  420.  
  421.             SendMessage (hClrCtrl, CB_SETCURSEL, 6, 0L);
  422.  
  423.             sets the seventh color in the list as the default.
  424.  
  425.             If the RGB color value of the desired default color is known,
  426.             but the index of the color is not known, a special color
  427.             selector message, CLRM_SETCURCOLOR can be used.  For example,
  428.  
  429.             SendMessage (hClrCtrl, CLRM_SETCURCOLOR, 0,
  430.                 RGB (0xFF,0x00,0x00));
  431.  
  432.             sets the current color selection to be red.  Note that if
  433.             the exact RGB color specified does not exist in the control's
  434.             list, the current color selection will not be changed, and a
  435.             CB_ERR value will be returned.  (When a combobox control is
  436.             created, its initial current selection is index 0, until
  437.             changed by a message such as those above.)
  438.  
  439.       4.    Retrieve the current color choice when the dialog is closed.
  440.  
  441.             When a user action indicates that the current dialog control
  442.             values should be retrieved and used (such as when the user
  443.             presses an "OK" or "Apply" button), the current color value
  444.             for a color selector can be retrieved as an RGB value by
  445.             using the special color selector message, CLRM_GETCURCOLOR.
  446.             For example,
  447.  
  448.             COLORREF rgbColor;
  449.             . 
  450.             .
  451.             .
  452.             rgbColor = SendMessage (hClrCtrl, CLRM_GETCURCOLOR, 0, 0L);
  453.  
  454.             will store in rgbColor the current RGB color selected in the
  455.             control.  (The last two parameters are ignored.)
  456.  
  457.       Message handling
  458.       ----------------
  459.  
  460.       To make the color selector control as flexible as possible, most
  461.       of the standard Windows messages and notification codes that are
  462.       supported by a combobox control also are supported by the color
  463.       selector control.  The following sections contain further
  464.       information about this support.
  465.  
  466.       Color selector messages
  467.  
  468.       CLRM_GETCURCOLOR      retrieve the RGB color of the current
  469.                             selected item in the control.  wParam and
  470.                             lParam are not used.  The return value of
  471.                             the SendMessage call is the current selected
  472.                             RGB value.  See the previous section for
  473.                             information on using this message.
  474.       CLRM_SETCURCOLOR      set the current selected item of the control
  475.                             to the specified RGB color.  wParam is not
  476.                             used for this message.  lParam is used to
  477.                             pass the desired RGB color value.  The
  478.                             return value of the SendMessage call is
  479.                             CB_ERR if the specified RGB color is not in
  480.                             the control's list.  See the previous
  481.                             section for information on using this
  482.                             message.
  483.  
  484.       Windows messages
  485.  
  486.       The following Windows messages are supported in the color
  487.       selector control, either by special processing or by default
  488.       processing handled within Windows.  See the SDK Reference manual
  489.       (volume 2) for more information on these messages.
  490.  
  491.       WM_CREATE             create the control on the dialog
  492.       WM_DESTROY            remove the control from the dialog
  493.       WM_SIZE               resize the control
  494.       WM_PAINT              repaint the control
  495.       WM_COMMAND            process commands from the user
  496.       WM_ACTIVATE           activate or inactivate the control
  497.       WM_CHAR               process a keyboard character sent to the
  498.                             control
  499.       WM_ENABLE             enable or disable the control
  500.       WM_KEYDOWN            process a key press for a non-system key
  501.       WM_KEYUP              process a key release for a non-system key
  502.       WM_KILLFOCUS          remove the input focus from the control
  503.       WM_MOVE               move the control onthe dialog
  504.       WM_SETFOCUS           give the input focus to the control
  505.       WM_SYSCHAR            process a system keystroke sent to the
  506.                             control
  507.       WM_SYSKEYDOWN         process a key press for a system key
  508.       WM_SYSKEYUP           process a key release for a system key
  509.  
  510.       The control sends the following messages to its dialog parent:
  511.  
  512.       WM_CTLCOLOR           ask the dialog to change the drawing
  513.                             attributes used to paint the control (note
  514.                             that these attributes are used to draw the
  515.                             structural aspects of the control, and do
  516.                             not affect the color choices in the color
  517.                             selector's list)
  518.       WM_DELETEITEM         tell the dialog that a color choice has been
  519.                             removed from the color selector's list
  520.       
  521.       These messages control the comobox-specific aspects of the
  522.       color control:
  523.  
  524.       CB_ADDSTRING          add an item to the end of a combobox's list
  525.       CB_DELETESTRING       delete an item from a combobox's list
  526.       CB_GETCOUNT           determine the number of items in a combobox's
  527.                             list
  528.       CB_GETCURSEL          determine the index of the currently selected
  529.                             item in a combobox
  530.       CB_GETITEMDATA        retrieve the data associated with an item in
  531.                             a combobox (for color selectors, this data is
  532.                             the stored RGB color value)
  533.       CB_INSERTSTRING       insert an item in the middle of a combobox's
  534.                             list
  535.       CB_RESETCONTENT       remove all items from a combobox's list
  536.       CB_SETITEMDATA        store a data value in a combobox item (for
  537.                             color selectors, this data is the RGB color
  538.                             value)
  539.       CB_SETCURSEL          change the currently selected item in a
  540.                             combobox
  541.  
  542.       Windows notification codes
  543.  
  544.       The color selector control returns the following combobox
  545.       notification codes to its parent window, in WM_COMMAND messages:
  546.  
  547.       See the SDK Reference manual (volume 2) for more information on
  548.       these codes.
  549.  
  550.       CBN_DROPDOWN          notify the dialog that the color selector
  551.                             listbox has been dropped down
  552.       CBN_KILLFOCUS         notify the dialog that the color selector
  553.                             control has lost the input focus
  554.       CBN_SELCHANGE         notify the dialog that the color selector
  555.                             current color has changed
  556.       CBN_SETFOCUS          notify the dialog that the color selector
  557.                             control has gained the input focus
  558.  
  559.  
  560.       SAMPLE PROGRAM
  561.  
  562.       This kit comes with a sample Windows program, CLRTEST.EXE.  This
  563.       program serves two purposes: first, it provides a good test of most
  564.       of the important functionality of the control and the interface
  565.       between the control and the application that uses it; second, it
  566.       represents a clean example of the control's implementation and use
  567.       in a program, without any complicated "applicaton-specific" code to
  568.       get in the way.  Other than that, this program does not do any
  569.       useful work--it is unlikely that anyone will want add it to one of
  570.       their Program Manager groups!  On the other hand, it may come in
  571.       handy as a starting point for testing special ways of interfacing
  572.       with the control, whenever changes to the control's standard
  573.       behavior are desired.
  574.  
  575.       Using the sample program
  576.       ------------------------
  577.  
  578.       Using the CLRTEST.EXE program is easy.  When run, the program
  579.       consists of a normal application window and a short application
  580.       menu.  The window contains a line of sample text that is colored
  581.       according to a default color value defined in the test program,
  582.       displayed on a background that is colored by another default color
  583.       value.  The application menu is described below.
  584.  
  585.       Application menu
  586.  
  587.       The test program's application menu contains three choices:  File,
  588.       Options, and Help.
  589.  
  590.       File menu
  591.  
  592.       The File menu has a standard meaning on most Windows applications,
  593.       but in this program, only one standard File menu option is
  594.       defined: Exit.  When Exit is chosen, the program simply shuts down.
  595.  
  596.       Options menu
  597.  
  598.       Under the Options menu, there is one option: Test Color Selector.
  599.       This option displays the "Color Test Attributes" dialog.
  600.  
  601.       Color Test Attributes Dialog
  602.  
  603.       This dialog is used to test the functionality of the color selector
  604.       control.  It contains a color selector control for "text color" and
  605.       one for "background color."  Changing the currently selected color
  606.       in either of these controls changes the corresponding current color
  607.       attribute for the program.  The pushbuttons on the dialog work in
  608.       the expected way: The OK button causes the main application window
  609.       to be redrawn using the current colors choices in the color
  610.       selectors.  The Cancel button leaves the current color settings for
  611.       the program as they were before the dialog box was displayed.  The
  612.       Reset button resets the current colors in the controls to the
  613.       default values defined in the program code.
  614.  
  615.       Note that each color selector has had colors added or removed from
  616.       the default set of sixteen pure colors.  The standard Dark Magenta
  617.       pure color has been removed from the text color selector, and a
  618.       sky-blue color has been added in the fourth position in the list.
  619.       Also, an orangish color has been added to the end of the background
  620.       color selector's list.  This is to test (and illustrate) the
  621.       ability to modify the control's behavior with standard Windows
  622.       messages, as standard controls (including comboboxes) allow.
  623.  
  624.       Help menu
  625.  
  626.       The help menu provides access to the Windows help file for the
  627.       CLRCTRL kit, which is an enhanced version of this text.  Besides
  628.       help information for the test program, it contains information
  629.       about using the color selector control in other applications.  In
  630.       addition, an "About Color Test..." option is defined, which
  631.       provides general information about the kit.
  632.  
  633.  
  634.       REGISTRATION
  635.  
  636.       This software product is SHAREWARE.  You are permitted to evaluate
  637.       this software product for a period of 30 days.  If, after that
  638.       period, you find the software product useful, you must register the
  639.       software product and send $15 with your name and address to the
  640.       address shown at the top of this text.  You will then be entitled
  641.       to receive a free floppy-disk copy of the next major revision of
  642.       the software product plus technical support for 3 months, at no
  643.       charge.
  644.  
  645.       You may also make additional copies for the purpose of allowing
  646.       others to evaluate the software product, as long as no
  647.       modifications or additions are made to the software, its
  648.       documentation, or any associated files, and this kit is not bundled
  649.       in a distribution of any other software except that which is
  650.       distributed as Shareware or Public Domain.
  651.  
  652.       Since this product is a programmer's kit, the RUN-TIME version of
  653.       this product, which consists of the .DLL file alone plus code
  654.       compiled against the .H file, may be distributed as part of a
  655.       RUN-TIME ONLY distribution of a commercial, shareware, or public
  656.       domain application.
  657.  
  658.  
  659.       FEEDBACK
  660.  
  661.       Lastly, if you find this software product useful and have any
  662.       interesting comments or ideas on how it might be improved,
  663.       please let me know!  I will attempt to incorporate the best of
  664.       these suggestions in future versions of this software product.
  665.       And, if you happen to provide particularly valuable feedback, I
  666.       will, at my discretion, register you free of charge.
  667.  
  668.       Also, watch for other custom controls to be available as shareware
  669.       soon.  If I get a positive response from this product, I have many
  670.       more that I will upload in the future!
  671.  
  672.       Thanks again for evaluating this product!
  673.  
  674.  
  675.       DISCLAIMER
  676.  
  677.       This software product is made available on an "as is" basis,
  678.       and carries no warranties, express or implied, including, but not
  679.       limited to, merchantability or fitness for a particular purpose.
  680.       The author shall in no way be held liable for any damages resulting
  681.       from the use of this software product or the media on which it is
  682.       distributed, including, without limitation, loss of business
  683.       profits, interruption of business, loss of information, damage to
  684.       equipment, or any other incidental or consequential damages.
  685.